/*
 * Form Controller
 */
// $("input.username").blur(function(){});

$("form").submit(function(){
	console.log(this);
	$(".response").remove();
	if(authenticateUser(this.username.value,this.password.value)) {
		$(this).append("<span class='response successText'><br/><br/>Login Successful!</span>");
	}
	else {
		$(this).append("<span class='response errorText'><br/><br/>Login Failed!</span>");
	}
	return false;
});

/*
 * Form Verification
 */

function authenticateUser(username,password)
{
	return ((username == "sunny" || username== "eric") && password == "dinglebox");
}